﻿using CinemaMaestro.DataLayer.Contracts.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CinemaMaestro.ViewModels
{
    public class CategoryViewModel
    {
        public int Id { get; set; }
        public string Name { get; set; }

        public static implicit operator CategoryViewModel(Category category)
        {
            return new CategoryViewModel
            {
                Id = category.Id,
                Name = category.Name
            };
        }

        public static implicit operator Category(CategoryViewModel categoryVM)
        {
            return new Category
            {
                Id = categoryVM.Id,
                Name = categoryVM.Name
            };
        }

        public override string ToString()
        {
            return this.Id.ToString() + " " + this.Name;
        }

    }
}
